﻿@using Super.Infrastructure
@{
    Layout = null;
    var loginUser = SuperService.LoginUser.User;
    var adp = new DbContextAdapter();
    var userService = new UserService(adp);
    var messageService = new MessageService(adp);
    var topicSevice = new TopicService(adp);
    var reservationService = new ReservationService(adp);

    var shopReservationCount = reservationService.GetShopReservationCount(loginUser.ID);
    
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/Assets/Style/base.css" rel="stylesheet" media="all">
    <link href="/Assets/Style/user.css" rel="stylesheet" media="all">
    <link type="text/css" rel="stylesheet" href="/Assets/Style/Validate.css" />
    <link href="/Assets/Plus/jBox/Skins/red/jbox.css" rel="stylesheet" type="text/css" />
    <script src="/Assets/script/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="/Assets/Plus/jBox/jquery.jBox-2.3.min.js" type="text/javascript"></script>
    <script src="/Areas/Admin/Assets/script/global.js" type="text/javascript"></script>
    <script src="/Assets/script/ajax.js" type="text/javascript"></script>
    <!--[if IE 6]>
<script type="text/javascript" src="/Assets/script/DD_belatedPNG_0.0.8a-min.js" ></script>
<script type="text/javascript">
	DD_belatedPNG.fix('.bt_01,.bt_02,.bt_03');
</script>
    <![endif]-->
    <title>@ViewBag.Title</title>
    @helper MenuLink(string path)
        {
   
             var c = ViewContext.RouteData.Values["controller"];
             var a = ViewContext.RouteData.Values["action"];
             var tmp = path.TrimStart('/').Split('/');
             var tmpc = tmp[0];
             var tmpa = tmp.Length < 2 ? "Index" : tmp[1];

             if (c.ToString().ToUpper() == tmpc.ToUpper() && a.ToString().ToUpper() == tmpa.ToUpper())
             {
        @:href="@path" class="m_l_on"
        }
             else
             {
        @:href="@path"
        }   
    }
</head>
<body>
    <div class="head_log">
        <div class="header_con mc">
            <a href="/home" class="logo_01"></a>
            <!--/logo-->
            <div class="loginbar">
                <table border="0">
                    <tr>
                        <td width="23">
                            <img src="@userService.GetAvatarUrl(loginUser, AvatarSizeEnum.Small)" width="24" height="24" /></td>
                        <td>
                            <a href="/usercenter"><b class="c_blue_1">@loginUser.UserName</b></a>
                            ，欢迎您！积分（<b class="c_red">@loginUser.Integral</b>）
                            站内信（<a href="/usercenter/message"><b class="c_green">@messageService.GetUserUnReadMessage(loginUser.ID)</b></a>）
                            <a href="/Login?a=out">退出</a>
                        </td>
                    </tr>
                </table>
            </div>
            <!--/loginbar-->
            <!--/loginbar-->
        </div>
    </div>
    <!--/head_log-->
    <div class="mian_bg pb20">
        <div class="mian h_auto mc">
            <div class="m_l fl">
                <dl class="bt_01">
                    <dt>管理信息：</dt>
                    <dd>
                        <a @MenuLink("/usercenter/mytopic") >我发布的主题（@topicSevice.GetTopicCountByUserId(loginUser.ID)）</a></dd>
                    <dd>
                        <a href="#">浏览过的帖子（0）</a></dd>
                    <dd>
                        <a @MenuLink("/usercenter/mymsg")>我发布的站内信（@messageService.GetUserSendMessageCount(loginUser.ID)）</a></dd>
                    <dd>
                        <a  @MenuLink("/usercenter/message")>收到的站内信（@messageService.GetUserMessageCount(loginUser.ID)）</a></dd>
                    <dd>
                        <a @MenuLink("/usercenter/myreservation")>我的预约（@reservationService.GetMyReservationCount(loginUser.ID)）</a>
                    </dd>
                </dl>
                <dl class="bt_02">
                    <dt>账户信息：</dt>
                    <dd>
                        <a @MenuLink("/usercenter/myprofile")>我的资料</a></dd>
                    <dd>
                        <a @MenuLink("/UserCenter/EmailBind")>用户认证</a></dd>
                </dl>
                @{
                    if (SuperService.LoginUser.ShopID > 0)
                    {
                        <dl class="bt_03">
                            <dt>商铺管理：</dt>
                            <dd>
                                <a @MenuLink("/shopcenter/index")>管理我的商铺</a></dd>
                            <dd>
                                <a href="#">快速发布内容</a>
                            </dd>
                            @if (shopReservationCount != -1)
                            {
                                <dd>
                                    <a @MenuLink("/shopcenter/reservation")>谁预约了我（@shopReservationCount）</a>
                                </dd>
                            }
                        </dl>
                    }
                }
            </div>
            <!--/m_l-->
            <div class="m_r fr">
                @RenderBody()
            </div>
            <!--/m_r-->
        </div>
        <!--/mian-->
    </div>
    <div class="footer">
        © 2003-2012 vipjiehun.com All rights reserved. VIP结婚网 版权所有</div>
    <!--/尾部-->
</body>
</html>
@Html.Raw(TempData["PageMessage"] as string)
